package com.lpb.spring.test.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @ClassName JdkProxy
 * @Description TODO
 * @date 2022/12/8 01:24
 * @Version 1.0
 * @authoe linpengbo
 */
public class JdkProxy implements InvocationHandler {

    private Object target;

    public  JdkProxy(Object target){
        this.target=target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("这里是jdk动态代理before...");
        Object invoke = method.invoke(target, args);
        System.out.println("这里是jdk动态代理after...");
        return invoke;
    }
}
